#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QApplication>
#include <QMainWindow>
#include <QPushButton>
#include <QHelpEngine>
#include <QHelpContentWidget>
#include <QHelpIndexWidget>
#include <QTabWidget>
#include <QSplitter>
#include <QTextBrowser>
#include <QFileInfo>
#include <QMessageBox>
#include <QMainWindow>
#include <HelpWindow.h>

#include <QHelpEngine>
#include <QHelpContentWidget>
#include <QHelpIndexWidget>
#include "HelpBrowser.h"

QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private:
private slots:
    void showHelp() {
            QString helpFile = "E:\\222078\\qt\\learn_help\\bmhelp.qhc";
        if (!QFileInfo::exists(helpFile)) {
            QMessageBox::warning(this, "错误", "找不到帮助文档文件: " + helpFile);
            return;
        }

        QString d = "qthelp://bmseven.myHelp/doc/index.html";
        HelpWindow::WINDOW_TITLE = "帮助文档";
        HelpWindow::INDEX_PAGE = d;
        HelpWindow::Q_ICON = ":/docs/help.png";
        HelpWindow* helpWindow = HelpWindow::getInstance(helpFile, this);
        helpWindow->showHelp(d);
    }

private:
    Ui::MainWindow *ui;
    QHelpEngine* helpEngine;
    int i;
private slots:
    void exec();
};
#endif // MAINWINDOW_H
